package com.javacode2018.demo2;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

@Component
public class UserDao {


    /**
     * 插入用户
     *
     * @param name
     * @return
     */
    public int insert(JdbcTemplate jdbcTemplate, String name) {
        return jdbcTemplate.update("insert into t_user (name) values (?)", name);
    }
}
